cmake_minimum_required(VERSION 3.10.2)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI})
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
cmake_policy(SET CMP0017 NEW)
SET(MSVC_INCREMENTAL_DEFAULT ON)
OPTION(BUILD_SHARED_LIBS "Use shared libraries" ON)
OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON)
FILE (STRINGS "VERSION" BULLET_VERSION)

#引用的头文件
include_directories(
        myEncapsulation
        bullet
        bullet/BulletCollision
        bullet/BulletCollision/BroadphaseCollision
        bullet/BulletCollision/NarrowPhaseCollision
        bullet/BulletCollision/CollisionDispatch
        bullet/BulletCollision/CollisionShapes
        bullet/BulletCollision/Gimpact
        bullet/BulletSoftBody
        bullet/BulletDynamics
        bullet/BulletDynamics/Vehicle
        bullet/BulletDynamics/ConstraintSolver
        bullet/BulletDynamics/Dynamics
        bullet/BulletDynamics/Character
        bullet/BulletDynamics/Featherstone
        bullet/BulletDynamics/MLCPSolvers
        bullet/LinearMath
        bullet/vectormath
)

add_subdirectory(bullet)

add_library(
        bullet-lib
        SHARED
        myEncapsulation/MatrixState.cpp
        myEncapsulation/ShaderUtil.cpp
        myEncapsulation/FileUtil.cpp
        myEncapsulation/TexPlane.cpp
        myEncapsulation/TexCuboid.cpp
        myEncapsulation/geometry/TextureRect.cpp
        myEncapsulation/geometry/TexturePlane.cpp
        hellocpp/main.cpp
)

#需要啥模块记得加进来
target_link_libraries(
        bullet-lib
        LinearMath
        Bullet3OpenCL_clew
        Bullet3Common
        BulletSoftBody
        BulletCollision
        BulletDynamics
        BulletInverseDynamics
        android
        log
        EGL
        GLESv3
)
